<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>																	
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link rel="stylesheet" href="${CSS}bootstrap.min.css">
	<link rel="stylesheet" href="${CSS}font-awesome.css">
	<link rel="stylesheet" href="${CSS}form.css">
	<link rel="stylesheet" href="${CSS}kalendae.css"/>
	<script src="${JS}jquery-3.2.1.min.js"></script>
	<script src="${JS}../../layer/layer.js"></script>
	<script src="${JS}bootstrap.min.js"></script>
	<script src="${JS}kalendae.js"></script>	
	<script src="${JS}form.js"></script>
	<script src="${JS}alert.js"></script>		
</head>
<body>
	<div class="container-fluid">
		<div class="row">		
		<div class="col-sm-12" style="padding-top:15px;">
		<c:if test="${USERINFO.mca[2] eq 'postview'}">
		<form class="form-horizontal" name="myform" method="ajax" action="post">
			<div class="form-group">
				<label class="col-sm-2 control-label">姓名：</label>
				<div class="col-sm-10">
					<input class="form-control" name="name" type="text" value="">						
				</div>
			</div>			
			<div class="form-group">
				<label class="col-sm-2 control-label">电话：</label>
				<div class="col-sm-10">
					<input class="form-control" name="mobile" type="text" value="">						
				</div>
			</div>	
			<div class="form-group">
				<label class="col-sm-2 control-label">地址：</label>
				<div class="col-sm-10">
					<input class="form-control" name="address" type="text" value="">						
				</div>
			</div>	
			<div class="form-group">
				<label class="col-sm-2 control-label">工作单位：</label>
				<div class="col-sm-10">
					<input class="form-control" name="work" type="text" value="">						
				</div>
			</div>	
			<div class="form-group">
				<label class="col-sm-2 control-label">爱好：</label>
				<div class="col-sm-10">
					<input class="form-control" name="hobby" type="text" value="">						
				</div>
			</div>	
				<div class="form-group">
				<label class="col-sm-2 control-label">备注：</label>
				<div class="col-sm-10">
					<input class="form-control" name="remark" type="text" value="">						
				</div>
			</div>			    						  											
			<div class="form-group" style="padding:0 15px;">
				<a class="btn btn-block btn-primary" id="save">提交</a>
			</div>						
		</form>
		</c:if>
		<c:if test="${USERINFO.mca[2] eq 'userinfo'}">
		<a class="btn btn-block btn-primary" href="/weixin/config/postview"><i class="fa fa-plus"></i> 添加通讯录</a>
		<ul class="list-group">
			<c:forEach items="${list}" var="v">
		    <li class="list-group-item">
		    	姓名：${v.name}<br>
		    	电话：${v.mobile}<br>
		    	地址：${v.address}<br>
		    	工作：${v.work}<br>
		    	爱好：${v.hobby}<br>
		    	备注：${v.remark}<br>
		    </li>
		    </c:forEach>
		</ul>
		</c:if>
		</div>
	</div>
</div>
<script>
var myform=form.init("myform");
$("#save").click(function(){
	myform.submit(function(res){
		layer.msg(res.msg);
		setTimeout(function(){
			location.href=res.url;
		},1000);
	});
});
</script>
</body>
</html>